It is already known that many programmable controllers have a function of providing a user with information on an execution error of a control program when an execution error occurs. This allows the user to analyze factors behind the execution error by using the information.
For example, Patent Literature 1 discloses a method in which a CPU (central processing unit) unit generates a return address for a subroutine program as execution error information. With this method, when a subroutine program is executed, a return address for the subroutine program is stored in a stack area by executing a sequence command to store the return address for the subroutine program. When an abnormality is detected in the executing of the subroutine program, the return address for the subroutine program stored in the stack area is referred to.
Patent Literature 2 discloses a method of providing a user with execution error information. In this method, when an abnormality is detected in a function block included in a user program, an identifier for status abnormality and a status code that describes the abnormality are retained in the memory of a programmable controller. The memory of the programmable controller can be accessed externally to determine the presence of the status abnormality, the function block with the abnormality, and abnormality factors.